<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'contract.label', default: 'Contract')}"/>
    <title>关联贷款合同</title>
</head>

<body>
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>PLS CINDATA</li>
                    <li>
                        <g:link controller="menu" action="index">CINDATA</g:link>
                    </li>
                    <li class="active">
                        <span>关联贷款合同</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                关联贷款合同
            </h2>
        </div>
    </div>
</div>

<g:form action="doRelated">
    <g:if test="${flash.message}">
        <div class="message alert alert-info" role="status">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${this.menu}">
        <ul class="errors" role="alert">
            <g:eachError bean="${this.menu}" var="error">
                <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                        error="${error}"/></li>
            </g:eachError>
        </ul>
    </g:hasErrors>

    <g:hiddenField name="mortgageId" value="${params['mortgageId']}" />
    <div class="content animate-panel">
        <div class="row">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    关联贷款合同
                </div>

                <div class="panel-body form-horizontal">

                    <div class="form-group">
                        <label class="col-md-2 control-label ">贷款合同</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="contract" id="contract" from="${com.cindata.Contract.list(max:1000, offset: 0)}" optionValue="contractNumber" optionKey="id" value="${this.vehicle?.type?.id}" noSelection="${['': '请选择贷款合同']}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-3 col-md-offset-6">
                            <g:submitButton class="btn btn-info" name="create" value="关联"/>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>



</g:form>

<g:javascript>
    $(function () {
        $('.datepicker').datepicker({
            language: 'zh-CN',
            format:"yyyy-mm-dd"
        });
        $('.input-group.date').datepicker({ });
        $('.input-daterange').datepicker({ });
    });

    // $("#city").bind("change", function(){
    //     $("#district option").remove();
    //     $("#s2id_district span:first").html("请选择行政区");
    //     var city = $("#city").val()
    //     $("#district").append("<option value='-1' >请选择行政区</option>")
    //     if(city=='-1'){
    //         return
    //     }
    //     $.ajax({
    //         url: "/estate/districtList",
    //         type: "POST",
    //         data: {'city': city} ,
    //         success: function(result){
    //             for(var i=0; i < result.districtList.length; i++){
    //                 $("#district").append("<option value=" + result.districtList[i].zoneNumber + ">" + result.districtList[i].name + "</option>")
    //             }
    //         }
    //     });
    // });
    // $("#city").change();

</g:javascript>
</body>
</html>
